package org.example;
/*
这是一个计算类，通过构造方法创建变量
 */
public class Arithmetic {
    private int a;
    private int b;
    public Arithmetic(int x,int y){
        a=x;
        b=y;
    }
    public int add(){
        return a+b;
    }
    public int subtract(){
        return a-b;
    }
    public int multiply(){
        return a*b;
    }
    public int divide(){
        if(b!=0){
            return a/b;
        }else return 0;
    }
}
